/*
 * @Descripttion: 会员模块接口
 * @version: 电子名片2.0
 * @Author: 冯健
 * @Date: 2020-11-21 10:02:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-11-13 14:54:19
 */
import request from '@/utils/request'

// =======================会员列表=======================

// 会员列表
export function menberList(params) {
  return request({
    url: '/member/platform/member/all',
    method: 'get',
    params: params
  })
}
// 会员标签选择框下拉列表
export function tagDownList() {
  return request({
    url:'/member/platform/member/tag/downList',
    method:'get'
  })
}
// 会员冻结
export function memberDj(data) {
  return request({
    url: '/member/platform/member/dj',
    method: 'post',
    data: data
  })
}

// 会员认证详情
export function memberAuthDetail(memberId) {
  return request({
    url: `/member/platform/member/att/${memberId}`,
    method: 'get',
    params: {}
  })
}

// 会员认证
export function memberAuth(type, memberId) {
  return request({
    url: `/member/platform/member/att/${type}/${memberId}`,
    method: 'post',
    params: {}
  })
}

// =======================会员等级=======================

// 列表
export function levelAll(params) {
  return request({
    url: '/member/platform/level/all',
    method: 'get',
    params: params
  })
}

// 详情
export function levelDetail(id) {
  return request({
    url: `/member/platform/level/detail/${id}`,
    method: 'get',
    params: {}
  })
}

// 启/停用
export function levelEnable(data) {
  return request({
    url: '/member/platform/level/use/enable',
    method: 'post',
    data: data
  })
}

// 删除
export function levelDelete(id) {
  return request({
    url: `/member/platform/level/del/${id}`,
    method: 'delete',
    params: {}
  })
}

// 添加
export function levelEdit(data, method) {
  return request({
    url: '/member/platform/level',
    method: method,
    data: data
  })
}

// 等级选择框列表
export function levelselList() {
  return request({
    url: '/member/platform/level/sel',
    method: 'get',
    params: {}
  })
}

// 会员权益
export function benefitsList() {
  return request({
    url: '/member/platform/level/benefits/new',
    method: 'get',
    params: {}
  })
}

// =======================会员套餐=======================

// 列表
export function mealAll(params) {
  return request({
    url: '/member/platform/member/meal/all',
    method: 'get',
    params: params
  })
}

// 删除
export function mealDelete(id) {
  return request({
    url: `/member/platform/member/meal/del/${id}`,
    method: 'delete',
    params: {}
  })
}

// 详情
export function mealDetail(id) {
  return request({
    url: `/member/platform/member/meal/detail/${id}`,
    method: 'get',
    params: {}
  })
}

// 启用/停用
export function mealEnable(data) {
  return request({
    url: '/member/platform/member/meal/use/enable',
    method: 'post',
    data: data
  })
}

// 新增或编辑
export function mealEdit(data, method) {
  return request({
    url: '/member/platform/member/meal',
    method: method,
    data: data
  })
}

// 禁用或解禁
export function memberForbidden(data) {
  return request({
    url: '/member/platform/member/dj',
    method: 'post',
    data: data
  })
}

// =======================会员统计=======================

// 会员总数
export function memberTotal(data) {
  return request({
    url: '/member/platform/statistical/member/total',
    method: 'get',
    params: data
  })
}

// 会员分析
export function memberAnalysis() {
  return request({
    url: '/member/platform/statistical/member/analysis',
    method: 'get',
    data: {}
  })
}

// 会员增长
export function memberGrowth(data) {
  return request({
    url: '/member/platform/statistical/member/growth/curve',
    method: 'get',
    params: data
  })
}

// 男女比例
export function memberGender(data) {
  return request({
    url: '/member/platform/statistical/member/growth/curve/gender',
    method: 'get',
    params: data
  })
}

// 年龄分布
export function memberAge(data) {
  return request({
    url: '/member/platform/statistical/member/growth/curve/age',
    method: 'get',
    params: data
  })
}

// 城市分布
export function memberArea(data) {
  return request({
    url: '/member/platform/statistical/member/growth/curve/area',
    method: 'get',
    params: data
  })
}

// 组织分析
export function statisticalAnalysis() {
  return request({
    url: '/sys/platform/statistical/member/analysis',
    method: 'get',
    data: {}
  })
}

// 组织增长
export function statisticalCurve(data) {
  return request({
    url: '/sys/platform/statistical/org/growth/curve',
    method: 'get',
    params: data
  })
}

// 组织规模分布
export function statisticalScale(data) {
  return request({
    url: '/sys/platform/statistical/org/growth/curve/scale',
    method: 'get',
    params: data
  })
}

// 组织行业分布
export function statisticalIndustry(data) {
  return request({
    url: '/sys/platform/statistical/org/growth/curve/industry',
    method: 'get',
    params: data
  })
}

// 组织商品（产品服务）总数
export function goodsTotal() {
  return request({
    url: '/sys/platform/statistical/goods/total',
    method: 'get',
    data: {}
  })
}

// 商品发布数量
export function goodsCurve(data) {
  return request({
    url: '/sys/platform/statistical/goods/growth/curve',
    method: 'get',
    params: data
  })
}

// 商品数据统计
export function goodsCurveData(data) {
  return request({
    url: '/sys/platform/statistical/goods/growth/curve/data',
    method: 'get',
    params: data
  })
}

// 组织总数
export function orgTotal(data) {
  return request({
    url: '/sys/platform/statistical/org/total',
    method: 'get',
    params: data
  })
}

// 动态总数
export function dynamicTotal() {
  return request({
    url: '/circle/platform/statistical/dynamic/total',
    method: 'get',
    data: {}
  })
}

// 动态发布数量
export function dynamicCurve(data) {
  return request({
    url: '/circle/platform/statistical/dynamic/growth/curve',
    method: 'get',
    params: data
  })
}


// 动态数据统计
export function dynamicCurveData(data) {
  return request({
    url: '/circle/platform/statistical/dynamic/growth/curve/data',
    method: 'get',
    params: data
  })
}
// ======================会员列表-会员详情=======================================
export function getMemberInfo(memberId){
  return request({
    url:`/member/platform/member/detail/${memberId}`,
    method:'get'
  })
}
// 会员列表-会员详情-标签标签
export function tagList(memberId){
  return request({
    url:`/member/platform/member/tag/list/${memberId}`,
    method:'get'
  })
}
// 会员列表-会员详情-会员标签-打标签弹窗列表
export function makeTagList(params){
  return request({
    url:'/member/platform/member/tag/relation/manual/all',
    method:'get',
    params
  })
}
// 会员列表-会员详情-会员打标签弹窗添加标签
export function makeTag(data){
  return request({
    url:`/member/platform/member/tag/relation/manual/new`,
    method:'post',
    data
  })
}
// 会员列表-会员详情-打标签列表-选中
export function chooseTags(data){
  return request({
    url:`/member/platform/member/tag/relation/manual/add`,
    method:'post',
    data
  })
}
// 会员列表-会员详情-打标签列表-取消
export function deleteTags(memberId,tagId){
  return request({
    url:`/member/platform/member/tag/relation/manual/del?memberId=${memberId}&tagId=${tagId}`,
    method:'delete'
    
  })
}

// ======================会员信息审核===========================================
// 会员信息审核列表-会员媒体审核列表
export function menberList2(params) {
  return request({
    url: '/member/platform/member/media/all',
    method: 'get',
    params: params
  })
}
// 会员信息审核记录
export function auditList(params) {
  return request({
    url:'/member/platform/member/media/record',
    method:'get',
    params: params
  })
}
// 会员信息审核-审核详情

export function checkDetails(id) {
  return request({
    url:`/member/platform/member/media/detail/${id}`,
    method:'get'
  })
}
// 会员信息审核-审核（同意或拒绝）
export function check(params) {
  return request({
    url:'/member/platform/member/media/auth',
    method:'post',
    params: params
  })
}
// =====================会员标签==================================================
// 会员标签列表
export function memberTagsList(params) {
  return request({
    url: '/member/platform/member/tag/all',
    method: 'get',
    params: params
  })
}
// 会员标签-详情
export function tagsDetail(id) {
  return request({
    url: `/member/platform/member/tag/detail/${id}`,
    method: 'get',
  })
}
// 会员标签-添加会员标签-添加/编辑
export function addOrUpdate(data) {
  return request({
    url: '/member/platform/member/tag/addOrUpdate',
    method: 'post',
    data
  })
}
// 添加会员标签编辑用户属性，所在城市
export function getCity(params) {
  return request({
    url: '/sys/platform/setting/universal/area',
    method: 'get',
    params
  })
}
// 会员标签-查看会员
export function getMember() {
  return request({
    url:'/member/platform/member/all',
    method:'get'
  }) 
}
// 会员标签-删除
export function tagDel(id) {
  return request({
    url:`/member/platform/member/tag/del/${id}`,
    method:'delete'
  }) 
}